<?php
ob_clean();

//分类数据结构重组
$cate = array();

//分类数据结构重组
$pid = !empty($_GET['id'])?$_GET['id']:0;

//树状型列表

$sql = "select * from `cate` where pid=$pid";
$result = mysqli_query($link,$sql);

while($arr = mysqli_fetch_assoc($result)){
	$cate[] = $arr;
}

//判断是否是ajax请求
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH'])){

	echo json_encode($cate);
	die;
}

//递归列表
// $cate = getCate();

// 加载后台首页视图
include(VIEW_PATH.$admin.'layout.html');



